package dch.service.admin.impl;

import dch.entity.Video;
import dch.persistent.admin.dao.AlbumDao;
import dch.persistent.admin.dao.VideoDao;
import dch.persistent.admin.impl.AlbumDaoImpl;
import dch.persistent.admin.impl.VideoDaoImpl;
import dch.service.admin.dao.VideoService;

public class VideoServiceImpl implements VideoService {

	VideoDao videoDao=null;
	AlbumDao albumDao=null;
	
	public VideoServiceImpl(){
		videoDao=new VideoDaoImpl();
		albumDao=new AlbumDaoImpl();
	}
	
	@Override
	public int insertVideo(Video video,int albumid) {
		return videoDao.insert(video,albumid);
	}
	@Override
	public void deleteVideo(int id) {
		videoDao.delete(id);
	}
	
	@Override
	public void updateVideo(Video video) {
		videoDao.update(video);
	}
	
	@Override
	public Video queryVideo(int id) {
		return videoDao.queryById(id);
	}
	public void close(){
		videoDao.close();
	}

}
